package com.smart.controller;

import com.smart.common.ResultVo;
import com.smart.entity.Goods;
import com.smart.entity.Orders;
import com.smart.service.OrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/admin")
public class AdminOmsController {
    @Autowired
    OrdersService ordersService;

    @GetMapping("/oms/all")
    public ResultVo OrdersAll() {
        List<Orders> ordersList = ordersService.OrdersAll();
        return ResultVo.ok().data("item", ordersList);
    }

    @GetMapping("/oms/success")
    public ResultVo OrderSuccess() {
        List<Orders> ordersList = ordersService.OrdersSuccess();
        return ResultVo.ok().data("item", ordersList);
    }

    @GetMapping("/oms/wait")
    public ResultVo OrdersWait() {
        List<Orders> ordersList = ordersService.OrdersWait();
        return ResultVo.ok().data("item", ordersList);
    }

    @GetMapping("/oms/abnormal")
    public ResultVo OrdersAbnormal() {
        List<Orders> ordersList = ordersService.OrdersAbnormal();
        return ResultVo.ok().data("item", ordersList);
    }

    @GetMapping("/oms/refund")
    public ResultVo OrdersRefund() {
        List<Orders> ordersList = ordersService.OrdersRefund();
        return ResultVo.ok().data("item", ordersList);
    }

}
